<?php
	function mk_num($start,$end)
	{
		#输入：起始号码、结束号码
		#返回：起始~结束的数组
		$nums = array();
		for ($i=$start; $i <= $end ; $i++) { 
			$nums[]=$i;
		}
		return $nums;
	}

	function chouJiang($nums,$geShu)
	{
		#输入：抽奖号码数组，抽奖名额
		#返回：抽中的号码数组
		shuffle($nums);

		$zhongJiangHao = array();
		for ($i=0; $i < $geShu ; $i++) { 
			$zhongJiangHao[]=$nums[$i];
		}
		return $zhongJiangHao;
	}
	function file2array($file)
	{
		$myfile = fopen($file, "r") or die("Unable to open file : $file !");
		while(!feof($myfile)) {
			$in = explode(' ', fgets($myfile));
			foreach ($in as $key => $value) {
				$nums[]=$value;
			}
		}
		fclose($myfile);
		return $nums;	
	}

?>